<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('博客管理')"/>
    <th:block th:include="include :: me-css"/>
    <th:block th:include="include :: semantic-css"/>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width-device-width, initial-scale=1.0"/>
    <title>首页</title>
<!--    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">-->
</head>
<body>

<!--导航-->
<!DOCTYPE html>
<nav class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">

            <h2 class="ui teal header item">Blog</h2>
            <!--            导航-->
            <a href="/blog/list" class="m-item item m-mobile-hide">首页</a>
<!--            <a href="#" class="m-item item m-mobile-hide"><i class="mini idea icon"></i> 分类</a>-->
<!--            <a href="#" class="m-item item m-mobile-hide"><i class="mini tags icon"></i>标签</a>-->
<!--            <a href="#" class="m-item item m-mobile-hide"><i class="mini clone icon"></i>归档</a>-->
<!--            <a href="#" class="m-item item m-mobile-hide"><i class="mini info icon"></i>关于我</a>-->
            <!--            搜索-->
            <div class="right m-item item m-mobile-hide">
                <div class="ui icon inverted transparent input">
                    <input name="query" type="text" placeholder="Search..."/>
                    <i class="search link icon"></i>
                    <!--                    <i onclick="document.forms['search'].submit()" class="search link icon"></i>-->
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>


<!--中间内容  m-container 可以调博客宽度-->
<div class="m-container m-padded-tb-large-small">
    <div class="ui container">
        <div class="ui stackable grid">
            <!--        博客目录部分，占5份-->
            <div class="eleven wide column">
                <!--                博客的头部-->
                <div class="ui top attached segment">
                    <div class="ui meddle aligned two column grid">
                        <div class="column">
                            <h2 class="ui teal header">博客</h2>
                        </div>
                        <div class="right aligned column">
                            共 <h2 class="ui orange header m-inline-blok m-text-thin" th:text="${dataInfo.total}">14</h2> 篇
                        </div>
                    </div>

                </div>

                <!--                    博客的首页目录-->
                <div class="ui attached segment">

                    <!--                    开始-->
                    <!-- 博客条目 m-padded-tb-large-blog 可以调博客的上面高距-->
                    <div class="ui padded vertical segment m-padded-tb-large-blog m-mobile-clear m-pandded-lr-mini" th:each="blog:${dataInfo.rows}">
                        <div class="ui middle aligned mobile reversed stackable grid" >
                            <div class="eleven wide column">
                                <h3 class="ui header"><a href="" class="m-black" target="_blank" th:href="@{/blog/info/{id}(id=${blog.id})}"
                                                         th:text="${blog.title}"></a>
                                </h3>
                                <p class="m-text" th:text="|${blog.summary}......|"></p>
                                <div class="ui stackable grid">
                                    <div class="eleven wide column">
                                        <div class="ui mini horizontal link list">
                                            <div class="item">
                                                <img src="#" th:src="@{${blog.avatar}}" alt="" class="ui avatar image" th:if="${not #strings.isEmpty(blog.avatar)}">
                                                <div class="content">
                                                    <a href="#" class="header" th:text="${blog.username}">一粒麦子</a>
                                                </div>
                                            </div>
                                            <div class="item">
                                                <i class="calendar alternate outline icon icon"></i><span
                                                    th:text="${#dates.format(blog.updateTime,'yyy年MM月dd日')}"></span>
                                            </div>
                                            <div class="item">
                                                <i class="tv icon"></i><span th:text="${blog.views}"></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="right aligned five wide column" th:if="${not #strings.isEmpty(blog.tags)}">
                                        <a href="#" target="_blank"
                                           class="ui teal basic label m-padded-tiny m-text-thin"
                                           th:text="${blog.tags}"></a>
                                    </div>
                                </div>
                            </div>
                            <div th:if="${not #strings.isEmpty(blog.thumbnail)}" class="five wide column" >
                                <a href="#" th:href="@{/blog/info/{id}(id=${blog.id})}" target="_blank" >
                                    <img src="https://unsplash.it/800/500?image=1005" width="190" height="100"  th:src="@{${blog.thumbnail}}"
                                         class="ui rounded image m-mobile-image">
                                </a>
                            </div>

                        </div>
                    </div>
                    <!--                    结束-->


                </div>
                <!--                博客的底部-->
                <div class="ui bottom attached segment" th:if="${(dataInfo.total>10)}">
                    <div class="ui meddle aligned two column grid">
                        <div class="column" th:if="${(dataInfo.currentPage>1) && dataInfo.total>10}">
                            <a href="#" th:href="@{/blog/list/(currentPage=${dataInfo.currentPage}-1)}" class="ui teal basic mini button"
                             >上一页</a>

                        </div>
                        <div class="right aligned column" >
                            <a  href="#" th:href="@{/blog/list/(currentPage=${dataInfo.currentPage}+1)}" class="ui teal basic mini button"
                             >下一页</a>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 右边栏 -->
            <div class="five wide column">

                <!-- 每日一句 -->
                <div class="ui segments ">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="idea icon"></i>每日一语
                            </div>

                        </div>
                    </div>
                    <div class="ui teal segment">
                        <div class="ui fluid vertical menu ">
                            <a   target="_blank" class="item">
                                <span th:text="${golden.golden}"></span>
                            </a>
                            <div style="text-align: right"  th:text="${golden.author}" th:if="${not #strings.isEmpty(golden.author)}"></div>
                        </div>
                    </div>
                </div>


                <!-- 分类栏 -->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="idea icon"></i>分类
                            </div>
                            <div class="right aligned column">
                                <a href="#" target="_blank">more<i class="angle double right icon"></i></a>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <div class="ui fluid vertical menu" th:each=" channel : ${channelList}">
                            <a href="#" target="_blank" class="item">
                                <span th:text="${channel.name}"></span>
                                <div class="ui teal basic left pointing label" th:text="${channel.weight}"></div>
                            </a>
                        </div>
                    </div>
                </div>

                <!-- 最新推荐 -->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment">
                        <i class="bookmark icon"></i>最新推荐
                    </div>
                    <div class="ui segment" th:each="newBlog : ${newPostList}">
                        <a href="#" target="_blank" class="m-black m-text-thin" th:href="@{/blog/info/{id}(id=${newBlog.id})}" th:text="${newBlog.title}"></a>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<!--底部内容-->
<footer class="ui inverted vertical segment m-padded-tb-massive">
    <div class="ui center aligned container">

        <!-- 版权 -->
        <p class="m-text-thin m-text-spaced m-opacity-tiny">copyright © 2022 - 2023 一粒麦子</p>
    </div>
</footer>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: semantic-js"/>
<!--<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.10/semantic.min.js"></script>-->

<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });
</script>

<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('mto:post:edit')}]];
    var selectDtail = [[${@permission.hasPermi('mto:post:selectDetail')}]];
    var removeFlag = [[${@permission.hasPermi('mto:post:remove')}]];
    var prefix = ctx + "mto/post";

</script>
</body>
</html>
